<template>
    <div>
        <swiper :swipeList="swipeList" :isfull="true"></swiper>
        <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="/home/newslist">
                    <!-- <span class="mui-icon mui-icon-home"></span> -->
                    <img src="../../img/menu1.png" alt="新闻资讯">
                    <div class="mui-media-body">新闻资讯</div></router-link></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="/home/photolist">
                    <!-- <span class="mui-icon mui-icon-email"><span class="mui-badge">5</span></span> -->
                    <img src="../../img/menu2.png" alt="图片分享">
                    <div class="mui-media-body">图片分享</div></router-link></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="/home/goodslist">
                    <!-- <span class="mui-icon mui-icon-chatbubble"></span> -->
                    <img src="../../img/menu3.png" alt="商品购买">
                    <div class="mui-media-body">商品购买</div></router-link></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <!-- <span class="mui-icon mui-icon-location"></span> -->
                    <img src="../../img/menu4.png" alt="留言反馈">
                    <div class="mui-media-body">留言反馈</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <!-- <span class="mui-icon mui-icon-search"></span> -->
                    <img src="../../img/menu5.png" alt="视频专区">
                    <div class="mui-media-body">视频专区</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <!-- <span class="mui-icon mui-icon-phone"></span> -->
                    <img src="../../img/menu6.png" alt="联系我们">
                    <div class="mui-media-body">联系我们</div></a></li>
        </ul> 
    </div>
</template>

<script>
import { Swipe, SwipeItem } from 'mint-ui';
import { Toast } from 'mint-ui';
import swiper from '../subcompontents/swiper.vue';

export default {
    data () {
        return {
            swipeList: [] // 保存轮播图的数据
        };
    },
    created () {
        this.getSwipe();
    },
    methods: {
      getSwipe() { // 获取轮播图数据的方法
        this.$axios.get('/api/getlunbo')
            .then(result => {
                // console.log(result);
                if(result.data.status === 0) {
                    // 成功了
                    this.swipeList = result.data.message;
                    Toast({message: '加载轮播图成功...',duration: 1000});
                } else {
                    // 失败了
                    Toast('加载轮播图失败...');
                }
            })
            .catch(error => {
                console.log(error);
            })
        // this.$axios({
        //     method: 'get',
        //     url: 'http://www.liulongbin.top:3005/api/getlunbo',
        // }).then((result) => {
        //     console.log(result.data);
        // }).catch((error) => {
        //     console.log(error);
        // })
      }  
    },
    components: {
        swiper,
        mtSwipeItem: SwipeItem
    }
}
</script>

<style lang="scss" scoped>
.mui-table-view.mui-grid-view.mui-grid-9 {
    background-color: white;
    border: none;
    img {
        width: 50%;
        height: 50%
    }
    .mui-media-body {
        font-size: 13px
    }
}
.mui-table-view-cell.mui-media.mui-col-xs-4.mui-col-sm-3 {
    border: 0px;
}
</style>